package cn.ibdsr.human.constant;

import lombok.Getter;
import lombok.Setter;

public enum CompanyStatusEnum {
    /**
     * 未认证
     */
    NO_SUBMIT(0, "未认证"),
    /**
     * 待认证
     */
    WATING(1, "待认证"),
    /**
     * 认证成功
     */
    SUCCESS(2, "认证成功"),
    /**
     * 认证失败
     */
    FAIL(3, "认证失败");

    /**
     * 状态值
     */
    @Setter
    @Getter
    private int type;
    /**
     * 状态描述
     */
    @Setter
    @Getter
    private String desc;


    CompanyStatusEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static CompanyStatusEnum valueOf(int status) {
        for (CompanyStatusEnum s : CompanyStatusEnum.values()) {
            if (s.getType() == status) {
                return s;
            }
        }
        return null;
    }
}
